package jkernel;

import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;

public class JavaBean {

    public static void main(String[] args) {
        try {
            BeanInfo bif = Introspector.getBeanInfo(Jbean.class);

            for (PropertyDescriptor pd : bif.getPropertyDescriptors()) {
                System.out.println(pd.getName());
                System.out.println("  " + pd.getReadMethod());
                System.out.println("  " + pd.getWriteMethod());
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

class Jbean {
    private String name;
    private int age;
    private boolean male;

    public boolean isMale() {
        return male;
    }

    public void setMale(boolean male) {
        this.male = male;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return this.age;
    }

    public void setAge(int age) {
        this.age = age;
    }

}
